%* REFCARD.TEX
%************************************************************************
%*                                                                      *
%*                  PC Scheme/Geneva 4.00 TeX code                      *
%*                                                                      *
%* (c) 1985-1988 by Texas Instruments, Inc. See COPYRIGHT.TXT           *
%* (c) 1993 by L. Bartholdi & M. Vuilleumier, University of Geneva      *
%*                                                                      *
%*----------------------------------------------------------------------*
%*                                                                      *
%*                     A Reference card for PCS                         *
%*                                                                      *
%*----------------------------------------------------------------------*
%*                                                                      *
%* Created by: Larry Bartholdi                    Date: 19931023        *
%* Revision history:                                                    *
%* - 18 Jun 92:	Renaissance (Borland Compilers, ...)                    *
%*                                                                      *
%*                                    ``In nomine omnipotentii dei''    *
%************************************************************************
\documentstyle[multicol,ps2]{article}
\pagestyle{empty}
\setlength{\topmargin}{-2cm}
\setlength{\oddsidemargin}{-2.2cm}
\setlength{\textheight}{21cm}
%**********
%\setlength{\textwidth}{29.3cm}
\setlength{\textwidth}{39.2cm}
%**********
\setlength{\unitlength}{1cm}
\setlength{\multicolsep}{0cm}

\font\manfnt=manfnt scaled 800	% with the dangerous bend sign
\chardef\bendchar="7F
\newcommand{\bend}{{\manfnt\bendchar}}

\newlength{\entlength}
\newlength{\arrowlead}
\setlength{\arrowlead}{-1.5mm}
\newcommand{\entfont}{\tt}
\newcommand{\ent}[2]{\makebox[\entlength][l]{{\entfont #1}}#2\\}
\newcommand{\res}[2]{\makebox[\entlength][l]{{\entfont
	#1}}\hspace{\arrowlead}$\Longrightarrow$\hspace{2mm}#2\\}
\newcommand{\mess}[3]{\makebox[\entlength][l]{\symb{{#1}} \argt{{#2}}}#3\\}
\newcommand{\mres}[3]{{\addtolength{\entlength}{\arrowlead}%
	\makebox[\entlength][l]{\symb{{#1}}
		\argt{{#2}}\dotfill}$\Rightarrow$\hspace{2mm}{#3}\\}}
\newcommand{\mval}[2]{{\addtolength{\entlength}{\arrowlead}%
	\makebox[\entlength][l]{\symb{{#1}}
		\opt{new-value}\dotfill}$\Rightarrow$\hspace{2mm}{#2}\\}}

\newcommand{\alt}[1]{{\sc Alt-#1}}
\newcommand{\argt}[1]{{\mediumseries\rm\it #1}\/}
\newcommand{\fq}[1]{$\langle${\mediumseries\rm\it #1}$\rangle$}
\newcommand{\ctrl}[1]{{\sc Ctrl\kern1pt-#1}}
\newcommand{\keypad}[1]{\fq{{\sc Keypad #1}}}
\newcommand{\meta}[1]{{\sc Meta\kern1pt-#1}}
\newcommand{\note}[1]{\hspace{1cm}\parbox{80mm}{\raggedright #1}\\}
\newcommand{\opt}[1]{{\mediumseries\rm{\normalshape [}\argt{#1}{\normalshape ]}}}
\newcommand{\Opt}[1]{{\mediumseries\rm\normalshape [}#1{\mediumseries\rm\normalshape ]}}
\newcommand{\shift}[1]{{\sc Shift-#1}}
\newcommand{\symb}[1]{{\it\tt '#1}}
\newcommand{\TeXcmd}[1]{{\tt\char92 #1}}
\newcommand{\Proc}[1]{$\lambda${\rm\normalshape ({\rm\it #1}\/)}}
\newcommand{\List}[1]{{\tt\normalshape ({\rm\it #1}\/)}}
\newcommand{\IND}[2]{$\mbox{#1}_{#2}$}
\newcommand{\OBJ}{\argt{obj}}
\newcommand{\CHAR}{\argt{char}}
\newcommand{\CLAS}{\argt{class}}
\newcommand{\LIST}{\argt{list}}
\newcommand{\PAIR}{\argt{pair}}
\newcommand{\STR}{\argt{string}}
\newcommand{\SYM}{\argt{symbol}}
\newcommand{\NUM}{\argt{number}}
\newcommand{\INT}{\argt{integer}}
\newcommand{\VECT}{\argt{vector}}
\newcommand{\ENV}{\argt{env}}
\newcommand{\PORT}{\argt{port}}
\newcommand{\WIN}{\argt{window}}
\newcommand{\OP}{\opt{port}}
\newcommand{\nth}{$n^{\mbox{\tiny th}}$}
%
\newcommand{\markup}{\noindent\begin{picture}(0,0)(0.34,-0.9)
	\thinlines
	\multiput(9.9,0)(9.9,0){3}{\line(0,-1){0.6}}
	\multiput(9.9,-21)(9.9,0){3}{\line(0,1){0.6}}
	\put(0,0){\line(1,0){39.6}\line(0,-1){21}}
	\put(39.6,-21){\line(-1,0){39.6}\line(0,1){21}}
	\end{picture}}
\newcommand{\notice}{{\bf\large {\Large PCS/G}ENEVA {\Large R}EFERENCE} \\
	Version~4.02---\copyright 1993 Larry Bartholdi, Marc Vuilleumier \\
	E-Mail: {\tt schemege@cui.unige.ch} --- FTP: {\tt cui.unige.ch:pub/pcs}}

\newenvironment{acculade}[1]%
	{\begingroup\def\tail{#1}%
		\dimen0=-\baselineskip
		$\mathsurround=-1pt \left.\begin{tabular}{@{}l@{}l@{}}
		\hspace{\entlength} & \\[\dimen0]}%
	{\end{tabular}\right\}$\relax\tail\\ \endgroup}

\begin{document}
\special{! statusdict begin a3tray end}
\frenchspacing
\footnotesize
\setlength{\topmargin}{-2.4cm}
%**********
%\begin{multicols}{3}
\begin{multicols}{4}
%**********
\markup
\raggedright\raggedcolumns
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%============================================================ EDWIN #1
\notice

\section*{Edwin: the Traditional Editor}
\setlength{\entlength}{3cm}
\renewcommand{\entfont}{\rm}
%
{\tt Edwin} is a sophisticated editor using {\sc Emacs}' key sequences\\[1mm]
\ent{\tt (edwin)}{starts the editor}
\ent{\tt (remove-edwin)}{forgets the editor}
\ent{\tt (edwin-reset-lines)}{resets the console to full-screen}
\meta{} can be {\sc Escape} or \ctrl Z.\\
\begin{center}
\begin{tabular}{lll}
	& {\bf Next}	& {\bf Previous} \\ \hline\rule{0pt}{2.5ex}%
Character	& \ctrl F	& \ctrl B \\
Word	& \meta F	& \meta B \\
Line		& \ctrl N	& \ctrl P \\
Sentence	& \meta A	& \meta E \\
Paragraph	& \meta{]}	& \meta{[} \\
Screen	& \ctrl V	& \meta V \\
List	& \meta{\ctrl N}	& \meta{\ctrl P} \\
S-Expr	& \meta{\ctrl F}	& \meta{\ctrl B} \\[3mm]
	& {\bf Last}	& {\bf First} \\ \hline\rule{0pt}{2.5ex}%
Line	& \meta{>}	& \meta{<} \\
\end{tabular}
\end{center}

\subsection*{Mark Commands}
\ent{\ctrl @}{set a mark}
\ent{\meta @}{mark a word}
\ent{\meta{\ctrl @}}{mark a Scheme expression}
\ent{\meta H}{mark the whole paragraph}
\ent{\ctrl X H}{mark the whole buffer}
\ent{\ctrl X \ctrl X}{exchange current position and mark}

\subsection*{Kill/Unkill Commands}
\ent{\sc Backspace}{delete the character before the cursor}
\ent{\ctrl D}{delete the character at the cursor}
\ent{\meta{$\backslash$}}{delete all spaces \& tabs around the point}
\ent{\meta{\sc Space}}{delete all spaces \& tabs except one}
\ent{\meta D}{kill the next word}
\ent{\meta{\sc Backspace}}{kill the previous word}
\ent{\ctrl K}{kill till end of line}
\ent{\meta K}{kill till end of sentence}
\ent{\ctrl X \sc Backspace}{kill backward to begin of sentence}
\ent{\meta{\ctrl K}}{kill next Scheme expression}
\ent{\ctrl W}{kill a region}
\ent{\meta W}{copy a region}
\ent{\ctrl Y}{yank back a kill}
\ent{\meta Y}{unkill using previous kill ring entry}
\ent{\meta{\ctrl W}}{append next kill to preceding kill}
\ent{\ctrl X \ctrl K}{expunge kill ring entry}
\vfill

%============================================================ EDWIN #2
\subsection*{File Commands}
\ent{\ctrl X \ctrl V}{visit a file}
\ent{\ctrl X \ctrl S}{save the buffer}
\ent{\ctrl X \ctrl W}{write the buffer}
\ent{\ctrl X \ctrl I}{insert a file}
\ent{\ctrl X \ctrl P}{put a region to a file}
\ent{\ctrl X \ctrl Q}{toggle read-only flag}
\ent{\meta{$\tilde{}$}}{ignore changes made to the buffer}

\subsection*{Breaking \& Indenting}
\ent{\ctrl O}{open the line}
\ent{\sc Return}{insert a line break}
\ent{\ctrl J}{insert a line break and indent}
\ent{\sc Tab}{indent the line (according to Scheme syntax)}
\ent{\meta{\ctrl Q}}{indent the next Scheme expression}

\subsection*{Miscellaneous}
\ent{\ctrl S}{search forward incrementally}
\ent{\ctrl R}{search backward incrementally}
\ent{\ctrl X \ctrl M}{toggle Fundamental/Scheme mode}
\ent{\ctrl X !}{toggle full/split screen}
\vspace{1mm}
\ent{\meta{\ctrl Z}}{evaluate the mark}
\ent{\meta{\ctrl X}}{evaluate the next Scheme expression}
\ent{\meta O}{evaluate the buffer}
\ent{\ctrl X \ctrl Z}{suspend {\tt edwin}}
\ent{\ctrl X \ctrl C}{exit the editor}
\ent{\ctrl L}{redraw the screen}
\ent{\ctrl U}{repeat a command}
\ent{\ctrl G}{abort the current command}
\ent{\ctrl Q}{quote the next character}
\ent{\ctrl T}{transpose (swap the last two characters)}

\subsection*{Inside {\mediumseries\tt (\%system-file-name "EDWIN.INI")}}
\setlength{\entlength}{5cm}
\renewcommand{\entfont}{\tt}
%
\ent{(set-edwin-key \argt{key} \argt{handler})}{define a new sequence}
\ent{(remap-edwin-key \argt{new-key} \argt{old-key})}{define an alias sequence}
\vspace{1mm}
Here \argt{key} can be a character or a list of characters.\\
Predefined chars are {\tt meta-char}, {\tt alt-char}, {\tt ctrl-x-char} and
{\tt ctrl-z-char}.
\vspace{2cm}
\vfill

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%============================================================ ED #1
\section*{Ed: a Generic Editor}
\setlength{\entlength}{4.2cm}
\renewcommand{\entfont}{\tt}
%
{\tt Ed} is an editor toolkit using a subset of {\sc Brief}'s key sequences\\[1mm]
{\setlength{\entlength}{5.7cm}
\res{(make-editor \opt{window} \opt{\symb{EXIT-FREELY}})}{a basic editor object}
}
\res{(make-enhanced-editor \ldots)}{ditto, with additional features}
\res{(make-color-editor \ldots)}{ditto, with block highlight}
\res{(make-scheme-editor \ldots)}{ditto, with scheme-specific rules}
\vspace{2mm}
%
Examples:\\
\setlength{\entlength}{5.4cm}
\ent{(define ed (make-\opt{\ldots {\tt-}}editor))}
{; create a full-screen editor}
\ent{(ed \symb{REMAP-KEY} 27 \symb{@GOTO-LINE})}
{; remap {\rm\sc Esc} to ''go to line''}
\ent{(ed \opt{filename})}
{; open the editor}
\vspace{1mm}
To create a multi-window editor, define two or more editors in different
windows; scrapbook and keystroke assignements will be shared by all.
%
\subsection*{Basic Editor Commands}
\newlength{\lrudarrowsize}
\settowidth{\lrudarrowsize}{$\leftrightarrow$}
\setlength{\fboxsep}{1.5pt}
\newcommand{\keyit}[1]{\fbox{#1}}
\newcommand{\sizeup}[1]{\makebox[\lrudarrowsize][c]{#1}}
\newcommand{\lrudarrow}{\sizeup{%
	\makebox[0mm][c]{$\leftrightarrow$}%
	\makebox[0mm][c]{$\updownarrow$}}}
\vspace{1mm}
\begin{tabular}{rclrcl}
\multicolumn{1}{l}{\makebox[18mm][l]{{\bf Step}}}	&
\keyit{$\uparrow$} & \makebox[10mm][l]{} & \multicolumn{1}{l}{\makebox[18mm][l]{{\bf Jump}}}	& \sizeup{{\sc PgUp}} \\
\keyit{$\leftarrow$} & \lrudarrow		& \keyit{$\rightarrow$}	& \ctrl{\keyit{$\leftarrow$}}	& \lrudarrow & \ctrl{\keyit{$\rightarrow$}} \\
					& \keyit{$\downarrow$}	&						&					& \sizeup{{\sc PgDn}} \\[3mm]
\multicolumn{1}{l}{{\large$\mathbf\infty$}} & \sizeup{\ctrl{\sc PgUp}} &	& \multicolumn{1}{l}{{\bf Delete}} \\
{\sc Home}			& \lrudarrow			& {\sc End}				& {\sc BackSpace}	& \lrudarrow & {\sc Del} \\
					& \sizeup{\ctrl{\sc PgDn}} \\
\end{tabular}
\vspace{2mm}
%
\setlength{\entlength}{2.2cm}
\renewcommand{\entfont}{\rm}
\ent{\alt I}{toggle \underline insert/overwrite mode}
\ent{\alt G}{\underline go to line}
\ent{\alt K}{\underline kill to end of line}
\ent{\alt D}{\underline delete current line}
\ent{\ctrl L}{refresh display}
\ent{\sc F7}{record a keystroke sequence}
\ent{\sc F8}{replay a keystroke sequence}
\ent{\sc F10}{execute a command by name}
\vspace{1mm}
\ent{\alt E}{\underline edit another file}
\ent{\alt W}{\underline write file to disk}
\ent{\alt O}{choose new \underline output name}
\ent{\alt R}{\underline read a file into current}
\ent{\alt X}{e\underline xit editor}
%
\subsection*{Enhanced Editor Commands}
Use a Color Editor if you want block highlight features.\\[1mm]
\ent{\alt M}{\underline mark block}
\ent{\alt L}{\underline line block}
\ent{\alt C}{\underline column block}
\ent{\keypad{$-$}}{cut block/line to scrap}
\ent{\keypad{$+$}}{copy block/line to scrap}
\ent{\keypad{$/$}}{invert block bounds (swap anchor)}
\ent{\sc Ins}{insert scrap into text}
\ent{\sc Del}{delete block}
\ent{\alt W}{\underline write block/file to disk}
\vspace{1mm}
\ent{\alt{{\normalshape [}$1\ldots 3${\normalshape ]}}}{drop a bookmark}
\ent{\alt J {\normalshape [}$1\ldots 3${\normalshape ]}}{\underline jump to bookmark}
\ent{\ctrl R}{\underline replicate a command}
\vspace{1mm}
\ent{\ctrl{\sc F5}}{toggle case sensivity}
\ent{\alt S or {\sc F5}}{\underline search string}
\ent{\shift{\sc F5}}{repeat previous search}
\ent{\alt T or {\sc F6}}{\underline translate string}
\ent{\shift{\sc F6}}{repeat previous translate}
\vfill

%============================================================ ED #2
\subsection*{Scheme Editor Commands}
Autoindent is active and color changes on each parenthesis level.\\[1mm]
\ent{\ctrl A}{enlarge mark around Scheme expression}
\ent{\ctrl Z}{mark the biggest Scheme expression}
\ent{\ctrl{\sc F10}}{evaluate marked expression}
\ent{\alt{\sc F10}}{evaluate current file}
\ent{\sc Tab}{complete symbol or reindent line/block}
\ent{\shift{\sc Tab}}{prepare to add a comment}
\ent{\alt Q \fq{key}}{use \argt{key}'s basic definition}
%
\subsection*{Driving an Editor}
\setlength{\entlength}{4.2cm}
{\tt Ed} is assumed to be an instance of an appropriate editor.\\[1mm]
{
\setlength{\entlength}{4.5cm}
\renewcommand{\entfont}{\tt}
\ent{(ed \opt{message} \opt{arguments})}{\argt{message} defaults to
\symb{OPEN}}
}
\vspace{1mm}
\mess{OPEN}{\opt{filename}}{pop-up the editor, handle commands}
\mess{SAFE}{}{ensure current buffer is saved}
\mess{CLEAR}{}{clear buffer}
\mval{NAME}{name of buffer}
\mval{BUFFER}{a list of strings}
\mval{POSITION}{cursor position}
\mval{INSERT}{{\tt \#F} when in overwrite mode}
\mval{TAB}{tab expansion width}
\mval{TABULIZE-MODE}{\symb{COMPRESS}, \symb{NORMAL} or \symb{EXPAND}}
\mval{SEPARATORS}{string (used for word move)}
\mval{CASE-SENSIVITY}{{\tt \#F} when disabled}
\mval{COLORS}{associative color list}
\mval{COMMENT-COLUMN}{column \#}
\mval{INDENT-TOKENS}{list of special tokens}
\mval{INPUT-PORT}{port used for input}
\mess{DO-STRING}{string}{feed editor with keystrokes}
\mres{READ-ACTION}{}{an \argt{action}: the next event}
\mess{HANDLE-ACTION}{action}{process one command}
\mess{REMAP-KEY}{key function}{}
\note{\argt{key} is {\tt (list* \opt{\ldots\ {\sc Ascii}$_2$} 
	\argt{{\sc Ascii}$_1$})}}
\note{\argt{function} if {\tt (list* \opt{\List{context action} \ldots} 
	\argt{default-action})}}
\note{\argt{context} is \Proc{ed} $\longrightarrow$ boolean}
\note{\argt{action} is a character, a string, or a symbol:}
\hbox{\hspace{3mm}\vrule
\setlength{\tabcolsep}{0mm}
\begin{tabular}{lll}
\makebox[3cm][l]{\symb{@LEFT}} &
\makebox[3cm][l]{\symb{@WORD-LEFT}} &
\makebox[3cm][l]{\symb{@HOME}} \\
\symb{@RIGHT} &
\symb{@WORD-RIGHT} &
\symb{@END} \\
\symb{@UP} &
\symb{@PAGE-UP} &
\symb{@TOP-OF-BUFFER} \\
\symb{@DOWN} &
\symb{@PAGE-DOWN} &
\symb{@END-OF-BUFFER} \\
\symb{@DEL} &
\symb{@DELETE-TO-EOL} &
\symb{@DELETE-LINE} \\
\symb{@BACKSPACE} &
\symb{@TAB} &
\symb{@ENTER} \\
\symb{@QUOTE} \\[1mm]
\symb{@INSERT-MODE} &
\symb{@GOTO-LINE} &
\symb{@REFRESH} \\
\symb{@RECORD} &
\symb{@PLAY} &
\symb{@EXECUTE} \\
\symb{@LOAD} &
\symb{@READ-INTO} &
\symb{@WRITE} \\
\symb{@RENAME} &
\symb{@EXIT} \\[1mm]
\symb{@SEARCH} &
\symb{@REPEAT-SEARCH} &
\symb{@CASE-SENSITIVITY} \\
\symb{@TRANSLATE} &
\symb{@REPEAT-TRANSLATE} &
\symb{@REPLICATE} \\
\symb{@BOOKMARK-\opt{{\bf 1\ldots3}}} &
\symb{@JUMP-TO-\opt{{\bf 1\ldots3}}} \\[1mm]
\symb{@MARK-BLOCK} &
\symb{@LINE-BLOCK} &
\symb{@COLUMN-BLOCK} \\
\symb{@CUT-BLOCK} &
\symb{@COPY-BLOCK} &
\symb{@INSERT-BLOCK} \\
\symb{@CANCEL-BLOCK} &
\symb{@SWAP-ANCHOR} \\[1mm]
\symb{@MARK-EXPR} &
\symb{@MARK-DEF} &
\symb{@SCHEME-PARENTHESIS} \\
\symb{@COMPLETION} &
\symb{@INDENT} &
\symb{@COMMENT} \\
\symb{@EVAL} &
\symb{@EVAL-BLOCK} &
\symb{@SCHEME-ENTER} \\
\end{tabular}
}
\vfill\newpage

\setlength{\topmargin}{-2cm}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%============================================================ BGI #1
\section*{\markup BGI: the Graphics Package}
\setlength{\entlength}{4.5cm}
\renewcommand{\entfont}{\tt}
%
Points and distances are represented as pairs. \\
The X-- and Y--components can be arbitrary numbers.\\[1mm]
\ent{(set-world!\ \argt{upper-left-point} \argt{lower-right-point})}{}

\subsection*{Control System}
\ent{(init-graph \opt{driver \opt{mode \opt{BGI-path}}})}{}
	\note{\argt{driver} is \symb{DETECT}, \symb{CGA}, \symb{MCGA},
	\symb{EGA}, \symb{EGA64}, \symb{EGAMONO}, \symb{IBM8514}, \symb{HERCMONO},
	\symb{ATT400}, \symb{VGA} or \symb{PC3270}}
\ent{(set-write-mode \argt{wmode})}{\argt{wmode} is \symb{COPY} or \symb{XOR}}
\ent{(restore-crt-mode)}{}
\ent{(set-graph-mode \opt{mode})}{}
\ent{(close-graph)}{}
\ent{(graph-defaults)}{}
\ent{(detect-graph)}{}
\ent{(get-mode-range \opt{driver})}{}
\ent{(get-graph-mode)}{}
\res{(install-user-driver \argt{name})}{a symbol (\argt{driver})}
	\note{\argt{name} is a string (filename without extension)}
\ent{(install-user-font \argt{name})}{a symbol (\argt{font})}

\subsection*{Drawing}
\setlength{\entlength}{3.6cm}
\ent{(line \argt{start-point} \argt{end-point})}{}
\ent{(rectangle \argt{upper-left-point} \argt{lower-right-point})}{}
\ent{(draw-poly \argt{list-of-points})}{}
\ent{(circle \argt{center-point} \argt{radius})}{}
\ent{(arc \argt{center-point} \argt{start-angle} \argt{end-angle} \argt{radius})}{}
\ent{(ellipse \argt{center-point} \argt{start-angle} \argt{end-angle} \argt{distances})}{}
\res{(get-arc-coords)}{\List{\argt{center-point} \argt{start-point} \argt{end-point}}}
\ent{(get-aspect-ratio)}{}
{\setlength{\entlength}{4cm}
\ent{(set-aspect-ratio \argt{factor})}{sets circles' and arcs' x--y aspect}
\ent{}{\argt{factor} is a fraction, passed as a pair}
}
\ent{(get-line-settings)}{}
\ent{(set-line-style \argt{line-style} \argt{user-pattern} \argt{thickness})}{}
	\note{\argt{line-style} is \symb{SOLID}, \symb{CENTER}, \symb{DOTTED}, \symb{DASHED} or \symb{USER-BIT}\\
	\argt{thickness} is \symb{NORMAL} (1), \symb{THICK} (3) or an integer}
\ent{(move-to \argt{point})}{{\tt (move-rel \argt{distances})}}
\ent{(line-to \argt{point})}{{\tt (line-rel \argt{distances})}}

\subsection*{Filling}
\ent{(flood-fill \argt{start-point} \argt{stop-color})}{}
\ent{(bar \argt{upper-left-point} \argt{lower-right-point})}{}
\ent{(bar-3d \argt{upper-left-point} \argt{lower-right-point} \argt{depth} \argt{draw-a-top?})}{}
\ent{(fill-poly \argt{list-of-points})}{}
\ent{(fill-ellipse \argt{center-point} \argt{distances})}{}
\ent{(pie-slice \argt{center-point} \argt{start-angle} \argt{end-angle} \argt{radius})}{}
\ent{(sector \argt{center-point} \argt{start-angle} \argt{end-angle} \argt{distances})}{}
\res{(get-fill-settings)}{\List{\argt{fill-style} \argt{color}}}
\ent{(set-fill-style \argt{fill-style} \argt{color})}{}
	\note{\argt{fill-style} is \symb{EMPTY}, \symb{SOLID}, \symb{LINE},
	\symb{[LT][BK]SLASH},
	\symb{HATCH}, \symb{XHATCH}, \symb{INTERLEAVE}, \symb{CLOSE-DOT} or
	\symb{WIDE-DOT}}
\res{(get-fill-pattern)}{\List{\argt{fill-pattern} \argt{color}}}
\ent{(set-fill-pattern \argt{fill-pattern} \argt{color})}{}
	\note{\argt{fill-pattern} is a list of integers}
\vfill

%============================================================ BGI #2
\subsection*{Bitmapping}
\res{(get-pixel \argt{point})}{\argt{color}}
\ent{(put-pixel \argt{point} \argt{color})}{}
{\setlength{\entlength}{6.6cm}
\res{(get-image \argt{upper-left-point} \argt{lower-right-point})}{a binary string}
}
\ent{(put-image \argt{new-upper-left-point} \argt{image-string} \argt{put-mode})}{}
	\note{\argt{put-mode} is \symb{COPY}, \symb{XOR}, \symb{OR}, 
	\symb{AND}, or \symb{NOT}} 
\ent{(image-size \argt{upper-left-point} \argt{lower-right-point})}{}
\res{(get-view-settings)}{\List{\argt{ul-point} \argt{lr-point} \argt{clip?}}}
\ent{(set-viewport \argt{upper-left-point} \argt{lower-right-point} \argt{clip?})}{}
\ent{(clear-viewport)}{}
\ent{(clear-device)}{}
\ent{(set-active-page \argt{page})}{}
\ent{(set-visual-page \argt{page})}{}

\subsection*{Writing Text}
\ent{(out-text-xy \argt{start-point} \argt{text-string})}{}
\ent{(out-text \argt{text-string})}{}
\res{(get-text-settings)}{\List{\argt{font} \argt{direction} \argt{size} \argt{horiz-just} \argt{vert-just}}}
\ent{(set-text-style \argt{font} \argt{direction} \argt{size})}{}
	\note{\argt{font} is \symb{DEFAULT}, \symb{TRIPLEX}, \symb{SMALL},
	\symb{SANS-SERIF}, \symb{GOTHIC}, \symb{SCRIPT}, \symb{SIMPLEX},
	\symb{TRIPLEX-SCR}, \symb{COMPLEX}, \symb{EUROPEAN} or \symb{BOLD}\\
	\argt{direction} is \symb{HORIZ} or \symb{VERT}\\
	\argt{size} is an integer between 1 and 10, or 0 for default}
\ent{(set-text-justify \argt{horiz-just} \argt{vert-just})}{}
	\note{\argt{horiz-just} is \symb{LEFT}, \symb{CENTER} or \symb{RIGHT}\\
	\argt{vert-just} is \symb{BOTTOM}, \symb{CENTER} or \symb{TOP}}
\ent{(set-user-char-size \argt{x-ratio} \argt{y-ratio})}{}
\res{(text-size \argt{text-string})}{a distance}

\subsection*{Using Color}
\setlength{\entlength}{4.5cm}
Predefined colors are:\\[1mm]
\hbox{\hspace{3mm}\vrule
\begin{tabular}{l@{\hspace{0.5cm}}l@{\hspace{0.5cm}}l}
\symb{BLACK} (0) &	\symb{BROWN} (6) &		\symb{LIGHT-CYAN} (11) \\
\symb{BLUE} (1) &	\symb{LIGHT-GRAY} (7) &	\symb{LIGHT-RED} (12) \\
\symb{GREEN} (2) &	\symb{DARK-GRAY} (8) &	\symb{LIGHT-MAGENTA} (13) \\
\symb{CYAN} (3) &	\symb{LIGHT-BLUE} (9) &	\symb{YELLOW} (14) \\
\symb{RED} (4) &	\symb{LIGHT-GREEN} (10) & \symb{WHITE} (15) \\
\symb{MAGENTA} (5)	& &
\end{tabular}
}
\vspace{1mm}
\ent{(get-color)}{{\tt (get-bk-color)}}
\ent{(set-color \argt{color})}{{\tt (set-bk-color \argt{color})}}
\ent{(get-max-color)}{}
\ent{(get-palette-size)}{}
\ent{(get-palette)}{{\tt (get-default-palette)}}
\ent{(set-palette \argt{entry} \argt{color})}{}
\ent{(set-rgb-palette \argt{entry} \argt{red} \argt{green} \argt{blue})}{}
\ent{(set-all-palette \argt{color-list})}{}

\subsection*{Miscellaneous}
\ent{(get-xy)}{{\tt (get-max-xy)}}
\ent{(get-driver-name)}{{\tt (get-mode-name \argt{mode})}}
\ent{(get-max-mode)}{}
\ent{(graph-error-msg \argt{error-id})}{}
\ent{(graph-result)}{}
\vfill

%============================================================ BGI #3
\subsection*{Hershey Fonts}
This package is an enhanced alternative to {\tt out-text}, providing\\
various special symbols, types and alphabets as well as a subset of \TeX.\\[1mm]
%
\newcommand{\BULLET}{\makebox[0mm][r]{$\bullet$\hspace{0.5em}}}
\ent{(load (\%system-file-name "HERSHEY.FSL"))}{}
\ent{(out-hershey \argt{string} \opt{position})}{}
\argt{position} is a \argt{point}\\
\argt{string} is a sequence of any of:\\
\note{\BULLET\TeXcmd{small}, \TeXcmd{large}, \TeXcmd{horiz}, \TeXcmd{vert},}
\note{\BULLET{\tt\char92}\fq{font} or
		{\tt\char92}\fq{font}\verb+@+\fq{scale}, where \fq{font} is:\\
	\hbox{\hspace{3mm}\vrule
	\begin{tabular}{llll}
	{\bf small}& {\bf light}& {\bf bold} \\[1mm]
	{\tt RM10} & {\tt RM2L} & {\tt RM2B} & {\rm Roman family}\\
	{\tt SL10} & {\tt SL2L} & {\tt SL2B} & {\sl Slanted family}\\
	{\tt SS10} & {\tt SS2L} & {\tt SS2B} & {\sf Sans-serif family}\\
	{\tt GR10} & {\tt GR2L} & {\tt GR2B} &
		{$\Gamma\rho\epsilon\epsilon\kappa$ family}\\[1mm]
	{\tt AN20} & {\tt GO20} & {\tt OE20} & Antique, Gothic \& Old English\\
	{\tt SY10} & {\tt SY20} & {\tt CY20} & Symbols \& Cyrillic\\
	\end{tabular}}
	and \fq{scale} is \INT\ or {\tt(\IND{\INT}{x},\IND{\INT}{y})},}
\note{\BULLET plain text or symbols (e.g.\ ``\verb*+See note+\TeXcmd{\TeXcmd{dagger}}''),}
\note{\BULLET grouping {\tt\{\}} to save/restore settings and delimit items,}
\note{\BULLET {\tt\char94}\fq{item} or {\tt\char95}\fq{item} for super- or sub-scripts}
\raisebox{8pt}{\bend} Beware that \verb+\+'s in strings must be doubled!

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section*{Debugging Tools}
\setlength{\entlength}{5cm}
\renewcommand{\entfont}{\tt}
%
In this section, \argt{proc} is a procedure to debug. \\[1mm]
\ent{(break[-entry,-exit,-both] \argt{proc})}{{\tt break} $\equiv$ {\tt break-entry}}
	\note{primes {\tt inspect}; binds {\tt *ARGS*}, {\tt *PROC*} and {\tt *RESULT*}}
\ent{(unbreak[-entry,-exit] \argt{proc})}{{\tt unbreak} kills both breakpoints}
\ent{(trace[-entry,-exit,-both] \argt{proc})}{{\tt trace} $\equiv$ {\tt trace-entry}}
\ent{(untrace[-entry,-exit] \argt{proc})}{}
\ent{(advise-entry \argt{proc} \argt{spy})}{\argt{spy} is \Proc{proc args env}}
\ent{(advise-exit \argt{proc} \argt{spy})}{\argt{spy} is \Proc{proc args env retval}}

\subsection*{The Inspector}
\setlength{\entlength}{3cm}
\renewcommand{\entfont}{\tt}
%
\ent{(inspect)}{starts the inspector}
\vspace{2mm}
\setlength{\entlength}{1.8cm}
\renewcommand{\entfont}{\rm}
%
\ent{?}{display the command summary}
\ent{!}{reset {\tt inspect}}
\ent{\ctrl A}{display \underline all environment frame bindings}
\ent{\ctrl B}{display prodecure call \underline backtrace}
\ent{\ctrl C}{display the \underline current environment binding}
\ent{\ctrl D}{move \underline down to callee's stack frame}
\ent{\ctrl E}{\underline edit a variable's binding}
\ent{\ctrl G}{\underline go (resume execution)}
\ent{\ctrl I}{evaluate an expression \& \underline inspect the result}
\ent{\ctrl L}{\underline list the current procedure}
\ent{\ctrl M}{repeat the breakpoint \underline message}
\ent{\ctrl P}{move to the \underline parent environment's frame}
\ent{\ctrl Q}{\underline quit (reset to top-level)}
\ent{\ctrl R}{\underline return from {\tt break} with a value}
\ent{\ctrl S}{move to \underline son environment's frame}
\ent{\ctrl U}{move \underline up to the caller's stack frame}
\ent{\ctrl V}{e\underline valuate one expression in the current environment}
\ent{\ctrl W}{\underline where (display the current stack frame)}
\vfill

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%============================================================ MOUSE #1
\section*{Using the Mouse}
\setlength{\entlength}{4cm}
\renewcommand{\entfont}{\tt}
%
All calls are handled through a ``mouse'' object:
\ent{\hspace{1cm}(mouse \argt{message} \opt{parameters}) $\Longrightarrow$
\argt{result}}{}
\vspace{-2mm}
\begin{tabbing}
Here \=\argt{button-set} is $\{\kern-2pt $\symb{LEFT} \symb{RIGHT} \symb{CENTER}$\kern2pt \}$\\
\>\argt{button}${}\in{}$\argt{button-set}\\
\>\argt{buttons-down}${}\subset{}$\argt{button-set}
\end{tabbing}
\vspace{-3mm}
\begin{flushleft}
\mess{RESET}{}{}
\mess{SHOW}{}{}
\mess{HIDE}{}{}
\mres{INQ}{}{\List{buttons-down x y}}
\mres{PRESS}{button}{\List{buttons-down press-count x y}}
\mres{RELEASE}{button}{\List{buttons-down release-count x y}}
\mess{MOVE}{x y}{}
\mess{LIMITS 'HORIZONTAL}{$x_0$ $x_1$}{}
\mess{LIMITS 'VERTICAL}{$y_0$ $y_1$}{}
\mess{LIMITS 'BOTH}{$x_0$ $x_1$ $y_0$ $y_1$}{}
{\setlength{\entlength}{5.5cm}
}
\mess{SHAPE}{shape}{}
	\note{\SYM\ or \List{x-hot-spot y-hot-spot and-mask xor-mask}}
\mres{CURSOR}{symbol}{a cursor. Available cursors are:}
\hbox{\hspace{3mm}\vrule
\setlength{\tabcolsep}{0mm}
\begin{tabular}{lllll}
\makebox[1.5cm][l]{\symb{CENTER}} &
\makebox[1.5cm][l]{\symb{LEFT}} &
\makebox[1.5cm][l]{\symb{RIGHT}} &
\makebox[1.5cm][l]{\symb{SMALL}} &
\makebox[1.5cm][l]{\symb{ARROW}} \\
\symb{UL-POINT} &
\symb{UR-POINT} &
\symb{LL-POINT} &
\symb{LR-POINT} &
\symb{HAND} \\
\symb{KEYBOARD} &
\symb{DISK} &
\symb{STAR4} &
\symb{STAR6} &
\symb{TARGET} \\
\symb{X} &
\symb{CROSSHAIR} &
\symb{CROSS} &
\symb{MOVE} &
\symb{BLOCK} \\
\symb{CIRCLE} &
\symb{EXCLAIM} &
\symb{HOURGLAS} &
\symb{CLOCK} &
\symb{KITE} \\
\symb{MESH} & 
\symb{SQUARE} & 
\symb{CALIPERS} &
\symb{CRAYON} &
\symb{ERASER} \\
\symb{HAIRS} &
\symb{HUMAN} &
\symb{IBAR} &
\symb{LASSO} &
\symb{PAINTCAN} \\
\symb{PENCIL} &
\symb{PENCIL2} &
\symb{PLIERS} &
\symb{SWORD} &
\symb{THE-BOOT} \\
\symb{SCISSORS} &
\symb{SCREWDRIVER}
\end{tabular}
}
\vspace{1mm}
\mess{TEXT-TYPE 'SOFTWARE}{and-item xor-item}{}
	\note{{\it and-item} and {\it xor-item} are \List{character .\ attribute}}
\mess{TEXT-TYPE 'HARDWARE}{start-row end-row}{}
{\setlength{\entlength}{5.3cm}
\mess{SMOOTH}{\opt{\symb{CHECK} $\mid$\symb{ENABLE} $\mid$\symb{DISABLE}}}{%
	{\sc Precise Point} services}
}
\mval{HANDLER}{previous \argt{handler}}
	\note{a {\it handler} is \List{events .\ proc}\\
	{\it events}${}\in$ \List{\symb{MOVE} \symb{LEFT-DOWN} \symb{LEFT-UP}
	\symb{LEFT} \symb{RIGHT-DOWN} \symb{RIGHT-UP} \symb{RIGHT}
	\symb{CENTER-DOWN} \symb{CENTER-UP} \symb{CENTER} \symb{UP} \symb{DOWN}
	\symb{BUTTONS}}}
	\note{{\it proc} is \Proc{events buttons-down x y mickeys-x mickeys-y}}
\mess{ENABLE}{}{\symb{DISABLE}}
\mess{PEN-ON}{}{\symb{PEN-OFF}}
\mess{EXCLUDE}{$x_0$ $y_0$ $x_1$ $y_1$}{}
\mess{MICKEY-RATIO}{x y}{}
\mess{SPEED-THRESHOLD}{speed}{}
\mval{SENSITIVITY}{\List{x y speed}}
\mres{MICKEYS}{}{\List{x y}}
\note{relative movement. A Mickey is $\approx 1/200\mbox{in}$}
\mval{POINTER-PAGE}{\argt{page}}
\mval{INFORMATION}{\List{version type IRQ}}
	\note{{\it type} is \symb{BUS}, \symb{SERIAL}, \symb{INPORT}, \symb{PS/2} or \symb{HP}}
\mval{LANGUAGE}{\argt{language}}
	\note{{\it language} is \symb{ENGLISH}, \symb{FRENCH},
	\symb{DUTCH}, \symb{GERMAN}, \symb{SWEDISH}, \symb{FINNISH}, \symb{SPANISH},
	\symb{PORTUGESE} or \symb{ITALIAN}}
\mess{INTERRUPT-RATE}{rate}{\argt{rate} is \symb{NONE}, 30, 50, 100 200}
\end{flushleft}
\vfill\newpage

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%============================================================ SEMANTICS #1
\markup\notice

\section*{Semantics}
\setlength{\entlength}{4.3cm}
\renewcommand{\entfont}{\tt}
%
\subsection*{Binding Forms}
\ent{(lambda \argt{formals-list} \argt{exp} \ldots)}{}
\ent{(named-lambda (\argt{name} \argt{formals}) \argt{exp} \ldots)}{}
\ent{(rec \argt{label} \argt{exp})}{}
\ent{(let[*,rec] \opt{label} ((\argt{var} \argt{value}) \ldots) \argt{exp} \ldots)}{}
{
\begin{tabular}{@{}l@{}l}
\tt (do{ } & ((\argt{var} \opt{init \opt{step}}) \ldots) \\
	& (\argt{terminate?\ result-exp} \ldots) \\
	& \argt{statement} \ldots)
\end{tabular}}\\

\subsection*{Fluid Environment}
\ent{(fluid-bound?\ \argt{var})}{}
\res{(fluid \argt{var})}{\argt{var}'s fluid binding}
\ent{(fluid-lambda \argt{formals-list} \argt{exp} \ldots)}{}
\ent{(fluid-let ((\argt{var} \argt{value}) \ldots) \argt{exp} \ldots)}{}
\ent{(set-fluid!\ \argt{var} \argt{obj})}{changes a fluid binding}

\subsection*{Literals}
\ent{(quote \argt{pattern})}{$\equiv$ {\tt '(\argt{pattern})}}
\ent{(quasiquote \argt{pattern})}{$\equiv$ {\tt `(\argt{pattern})}}
\ent{(unquote \argt{expression})}{$\equiv$ {\tt ,(\argt{exp})}. Valid within {\tt quasiquote}}
\ent{(unquote-splicing \argt{exp})}{$\equiv$ {\tt ,@(\argt{exp})}. Valid within {\tt quasiquote}}

\subsection*{Sequencing \& Control}
\setlength{\entlength}{4.7cm}
\ent{(if \argt{predicate} \argt{consequent} \opt{alternative})}{}
\ent{(when \argt{predicate} \argt{exp} \ldots)}{}
\ent{(apply-if \argt{predicate} \Proc{trigger} \argt{exp-false})}{}
\ent{(case \argt{item} (\argt{selector} \argt{exp} \ldots) \ldots\ \Opt{(else \argt{exp \ldots})})}{}
\note{\argt{selector} is \argt{item-value} or \List{item-value \ldots}}
\ent{(cond \argt{clause} \ldots\ \Opt{(else \argt{exp \ldots})})}{}
\note{\argt{clause} is \List{predicate exp \ldots} or \List{predicate
	{\tt\normalshape =>} \Proc{trigger}}}
\res{(and \argt{exp} \ldots)}{value of last true \argt{exp}, or {\tt \#F}}
\res{(or \argt{exp} \ldots)}{value of first true \argt{exp}, or {\tt \#F}}
\ent{(not \argt{exp})}{}
\res{(begin \IND{\argt{exp}}1 \ldots\ \IND{\argt{exp}}{n})}{\IND{\argt{exp}}n}
\res{(begin0 \IND{\argt{exp}}1 \ldots\ \IND{\argt{exp}}{n})}{\IND{\argt{exp}}1}

\subsection*{Syntax \& Errors}
\ent{(alias \argt{new-name} \argt{old-name})}{}
\ent{(syntax \argt{pattern} \argt{expansion})}{\argt{pattern} is a list structure}
\ent{(define-integrable \argt{name} \argt{value})}{\argt{name} will be expanded inline}
\ent{(macro \argt{name} \argt{expander})}{\argt{expander} is \Proc{exp}}
	\note{if \argt{expander} is \symb{()}, \argt{name} is unaliased}
\vspace{2mm}
\ent{(assert \argt{predicate} \argt{message} \ldots)}{}
\ent{(bkpt \argt{message} \argt{irritant-exp})}{}
\ent{(error \argt{message} \argt{irritant-exp} \ldots)}{}
\vfill

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%============================================================ OPERATORS #1
\section*{Operators}
\setlength{\entlength}{4.4cm}
\renewcommand{\entfont}{\tt}
%
\subsection*{Booleans}
\ent{\makebox[1cm][l]{\#T}\makebox[1cm][l]{\#F}}{\symb{()}
	is currently evaluated to {\tt \#F}}
\ent{(boolean?\ \OBJ)}{}

\subsection*{Equivalence Predicates}
\ent{(eq?\ \IND\OBJ1 \IND\OBJ2)}{tests physical equality}
\ent{(eqv?\ \IND\OBJ1 \IND\OBJ2)}{tests numbers, strings \& characters}
\ent{(equal?\ \IND\OBJ1 \IND\OBJ2)}{tests visual appearances}

\subsection*{Pairs \& Lists}
\ent{\symb{()}}{the empty list}
\ent{(pair?\ \OBJ)}{}
\ent{(null?\ \OBJ)}{}
\ent{(atom?\ \OBJ)}{$\equiv$ {\tt (not (pair?\ \OBJ))}}
\res{(list?\ \OBJ)}{{\tt \#T} if \OBJ\ is \symb{()} or \List{\OBJ\ .\ \LIST}}
\ent{(list->stream \LIST)}{}
\ent{(list->string \LIST)}{}
\ent{(list->vector \LIST)}{}
\res{(implode \LIST)}{a symbol (built of \LIST's elements)}
\ent{(append[!]\ \LIST\ \ldots)}{{\tt append!} alters all lists but the last}
\ent{(apply \Proc{arg \ldots} \argt{argument-list})}{}
\ent{([assoc,assq,assv] \OBJ\ \argt{pair-list})}{}
\ent{(c[[a,d] \ldots]r \PAIR)}{up to 4 levels of ``{\tt a}'' and ``{\tt d}''}
\ent{(cons \IND\OBJ1 \IND\OBJ2)}{}
\ent{(copy \LIST)}{}
\ent{([delete!,delq!]\ \OBJ\ \LIST)}{}
\ent{(last-pair \LIST)}{}
\ent{(length \LIST)}{}
\ent{(list \OBJ\ \ldots)}{}
\ent{(list* \OBJ\ \ldots)}{creates a dotted list}
\ent{(list-ref \LIST\ \argt{index})}{\argt{index} starts at 0}
\ent{(list-tail \LIST\ \argt{index})}{}
\res{([member,memq,memv] \OBJ\ \argt{list})}{list-tail starting with \OBJ\ or
{\tt \#F}}
\ent{(reverse[!]\ \LIST)}{{\tt reverse!} destroys its argument}
\ent{(set-c[a,d]r!\ \PAIR \OBJ)}{}
\vspace{2mm}
\ent{(for-each \Proc{arg \ldots} \LIST\ \ldots)}{calls \argt{proc} with an item of
each list}
\res{(map \Proc{arg \ldots} \LIST\ \ldots)}{list of resulting values}

\subsection*{Streams: Lists Evaluating on Demand}
\ent{THE-EMPTY-STREAM}{}
\ent{(stream?\ \OBJ)}{}
\ent{(empty-stream?\ \argt{stream})}{}
\ent{(stream->list \argt{stream})}{}
\ent{(cons-stream \IND\OBJ1 \IND\OBJ2)}{}
\ent{(head \argt{stream})}{}
\ent{(tail \argt{stream})}{}
\ent{(delayed-object?\ \OBJ)}{}
\ent{(delay \argt{exp})}{freezes and memoises \argt{exp}}
\ent{(force \argt{delayed-object})}{}
\ent{(freeze \argt{exp})}{}
\ent{(thaw \argt{freezed-object})}{}
\vfill

%============================================================ OPERATORS #2
\subsection*{Numbers}
\setlength{\entlength}{4.2cm}
Current release uses {\sc Ieee}~64-bit floating point and precise integer 
computations in range $\approx\pm 10^{40000}$. Exact floating point,
rational and complex numbers are currently not implemented.\\
\ent{(number?\ \OBJ)}{}
\ent{(complex?\ \OBJ)}{currently $\equiv$ {\tt number?}}
\ent{(real?\ \OBJ)}{currently $\equiv$ {\tt number?}}
\ent{(rational?\ \OBJ)}{currently $\equiv$ {\tt integer?}}
\ent{(integer?\ \OBJ)}{}
\note{whether \OBJ\ results from exact integer computations}
\ent{(float?\ \OBJ)}{$\equiv$ \raisebox{-1.6ex}{{\tt 
\begin{tabular}{@{}l@{\ }l}
(and	& (number?\ \OBJ) \\
	& (not (integer?\ \OBJ)))
\end{tabular}}}}
\res{(exact?\ \NUM)}{currently $\equiv$ {\tt integer?}}
\res{(inexact?\ \NUM)}{currently $\equiv$ {\tt float?}}
\ent{(negative?\ \NUM)}{}
\ent{(zero?\ \NUM)}{}
\ent{(positive?\ \NUM)}{}
\ent{(number->string \NUM\ \opt{radix})}{\hspace{7mm}\argt{radix} is 2, 8, 10 or 16}
\res{(float \NUM)}{{\sc Ieee}~64-bit representation}
\res{(truncate \NUM)}{\NUM\ rounded to zero}
\res{(round \NUM)}{nearest integer, tie breaks even}
\res{(floor \NUM)}{integer $\in\, ]\mbox{\NUM}-1;\:\mbox{\NUM}]$}
\res{(ceiling \NUM)}{integer $\in [\mbox{\NUM};\:\mbox{\NUM}+1[$}
\ent{(1+ \NUM)}{$\equiv$ {\tt ADD1}}
\ent{(-1+ \NUM)}{$\equiv$ {\tt SUB1}}
\ent{([minus,-] \NUM)}{unary minus}
\ent{(/ \NUM)}{inverse}
\ent{(abs \NUM)}{}
\ent{(+ \opt{\NUM} \ldots)}{{\tt (- \opt{\IND\NUM1 \IND\NUM2} \ldots)}}
\ent{(* \opt{\NUM} \ldots)}{{\tt (/ \opt{\IND\NUM1 \IND\NUM2} \ldots)}}
\ent{(< \opt{\NUM} \ldots)}{{\tt (>= \opt{\NUM} \ldots)}}
\ent{(> \opt{\NUM} \ldots)}{{\tt (<= \opt{\NUM} \ldots)}}
\ent{(= \opt{\NUM} \ldots)}{{\tt (<> \opt{\NUM} \ldots)}}
\ent{(min \opt{\NUM} \ldots)}{{\tt (max \opt{\NUM} \ldots)}}
\ent{(sqrt \NUM)}{}
\ent{(exp \opt{base} \argt{exponent})}{$\equiv$ {\tt expt}}
\ent{(log \NUM\ \opt{base})}{}
\ent{(sin \NUM)}{{\tt (asin \NUM)}}
\ent{(cos \NUM)}{{\tt (acos \NUM)}}
\ent{(tan \NUM)}{{\tt (atan \NUM\ \opt{divisor})}}
%
\vspace{2mm}
\ent{(even?\ \INT)}{}
\ent{(odd?\ \INT)}{}
\ent{(integer->string \INT\ \argt{radix})}{\hspace{7mm}\argt{radix} is any arbitrary integer}
\res{(integer->char \INT)}{\nth\ character from {\sc Ascii} code}
\res{(ascii->symbol \INT)}{a one-char symbol}
\begin{acculade}{}
\tt (quotient \argt{dividend} \argt{divisor})	& rounds to zero \\
\tt (remainder \argt{dividend} \argt{divisor})	& same sign as \argt{dividend}
\end{acculade}
\begin{acculade}{}
\tt (divide \argt{dividend} \argt{divisor})	& rounds to $-\infty$ \\
\tt (modulo \argt{dividend} \argt{divisor})	& same sign as \argt{divisor}
\end{acculade}
\ent{(gcd \INT\ \ldots)}{greatest common divisor}
\ent{(lcm \INT\ \ldots)}{least common multiple}
\ent{(bitwise-and \INT\ \ldots)}{}
\ent{(bitwise-or \INT\ \ldots)}{}
\ent{(bitwise-xor \INT\ \ldots)}{}
\res{(random \argt{range})}{a non-negative integer ${} < \mbox{\argt{range}}$}
\ent{(randomize \opt{\INT})}{random seed; defaults to time-of-day}
\vfill

%============================================================ OPERATORS #3
\subsection*{Characters}
\setlength{\entlength}{5.4cm}
\begin{tabbing}
\tt\hspace{2cm}\=\hspace{2cm}\=\hspace{2cm}\=\hspace{2cm}\=\hspace{2cm}\=\kill
\verb+#\BACKSPACE+	\> \verb+#\ESCAPE+	\> \verb+#\NEWLINE+ \> \verb+#\PAGE+ \\
\verb+#\RETURN+	\> \verb+#\RUBOUT+	\> \verb+#\SPACE+	\> \verb+#\TAB+
\end{tabbing}
\vspace{-2mm}
\ent{(char?\ \OBJ)}{}
\ent{(char->integer \CHAR)}{using {\sc Ascii} character set}
\res{(string \CHAR\ \ldots)}{a string built of \CHAR s}
\ent{(char-downcase \CHAR)}{}
\ent{(char-upcase \CHAR)}{}
\ent{(char-ci[<,<=,=,>,>=]?\ \IND\CHAR1 \IND\CHAR2)}{case-insensitive}
\ent{(char[<,<=,=,>,>=]?\ \IND\CHAR1 \IND\CHAR2)}{}

\subsection*{Strings}
\renewcommand{\entfont}{\tt}
%
Strings are enclosed in {\tt "\ldots"}; All indexes start at 0\\[1mm]
\ent{(string?\ \STR)}{}
\ent{(string-null?\ \STR)}{}
\res{(string->list \STR)}{a list of chars}
\ent{(string->number \STR\ \opt{radix})}{\argt{radix} is 2, 8, 10 or 16}
\ent{(string->symbol \STR)}{}
\res{(string->uninterned-symbol \STR)}{a unique symbol}
\ent{(make-string \argt{length} \opt{init-char})}{}
\ent{(string-append \opt{\STR} \ldots)}{returns {\tt ""} when no arguments}
\ent{(string-copy \STR)}{}
\ent{(string-fill!\ \STR\ \argt{fill-char})}{}
\res{(string-length \STR)}{an integer}
\res{(string-ref \STR\ \argt{index})}{\nth\ char of \STR}
\ent{(string-set!\ \STR\ \argt{index} \CHAR)}{}
\ent{(string-ci[<,=] \IND\STR1 \IND\STR2)}{case-insensitive}
\ent{(string[<,<=,=,>=,>] \IND\STR1 \IND\STR2)}{}
\vspace{2mm}
\res{(substring \STR\ \argt{start} \argt{end})}{\STR\/[\argt{start}\ldots\argt{end}-1]}
\ent{(substring-fill!\ \STR\ \argt{start} \argt{end} \argt{fill-char})}{}
\ent{(substring-find-next-char-in-set \STR\ \argt{start} \argt{end} \argt{char-set})}{}
\ent{(substring-find-previous-char-in-set \STR\ \argt{start} \argt{end} \argt{char-set})}{}
	\note{$\Longrightarrow$\hspace{2mm}index or {\tt \#F}.
		\argt{char-set} is a character or a string}
\ent{(substring-find-next-string[-ci] \STR\ \argt{start} \argt{end} \argt{match})}{}
\ent{(substring-find-previous-string[-ci] \STR\ \argt{start} \argt{end} \argt{match})}{}
\ent{(substring-move-[left,right]!\ \IND\STR1\,\IND{\argt{start}}1\,\IND{\argt{end}}1\,\IND\STR2\,\IND{\argt{start}}2\,)}{}
	\note{The direction is important only if the substrings overlap}
\ent{(substring-ci[<,=] \IND\STR1 \IND{\argt{start}}1 \IND{\argt{end}}1
	\IND\STR2 \IND{\argt{start}}2 \IND{\argt{end}}2)}{}
\ent{(substring[<,<=,=,>=,>] \IND\STR1 \IND{\argt{start}}1 \IND{\argt{end}}1
	\IND\STR2 \IND{\argt{start}}2 \IND{\argt{end}}2)}{}
\res{(sprintf \argt{template} \opt{\OBJ} \ldots)}{a string}
\res{(sscanf \argt{input-string} \argt{template})}{\List{\opt{\OBJ} \ldots}}

\subsection*{Symbols}
\setlength{\entlength}{4.4cm}
\renewcommand{\entfont}{\tt}
%
Symbols can be enclosed in {\tt |\ldots|}\\[1mm]
\ent{(symbol?\ \OBJ)}{}
\ent{(symbol->string \SYM)}{}
\res{(symbol->ascii \SYM)}{{\sc Ascii} code of $1^{\mbox{\tiny st}}$ char
of \SYM}
\res{(explode \SYM)}{a list of one-char symbols}
\res{(gensym \opt{string, number})}{a new uninterned symbol}
	\note{optionally sets the string prefix or initialize the counter suffix}
{\setlength{\entlength}{6.7cm}
\res{(property \SYM\ \opt{property-name \opt{new-value}})}{old value(s)}
	\note{if \argt{new-value} is {\tt\it\#!UNDEFINED}, the property is removed}
}
\vfill\newpage

%============================================================ OPERATORS #4
\subsection*{\markup Ports \& Windows}
\setlength{\entlength}{4.7cm}
\ent{\symb{CONSOLE}}{a port: the display and keyboard}
\ent{MAX-CONSOLE}{\List{lines .\ cols}, the display's size}
\ent{PCS-STATUS-WINDOW}{the bottom line's window}
\ent{STANDARD-[INPUT,OUTPUT]}{the standard I/O ports}
\ent{[INPUT,OUTPUT]-PORT}{fluidly bound to current ports}
\ent{(port?\ \OBJ)}{}
\ent{(window?\ \OBJ}{}
\ent{(input-string?\ \OBJ)}{}
\ent{(input-port?\ \PORT)}{}
\ent{(output-port?\ \PORT)}{}
\ent{(char-ready?\ \PORT)}{}
\ent{(eof-object?\ \OBJ)}{}
{\setlength{\entlength}{6cm}
\begin{acculade}{$\Longrightarrow$\hspace{2mm}a port}
\tt (open[-binary]-[input,output]-file \argt{filename})\\
\tt (open-extend-file \argt{filename})\\
\tt (open-input-string \STR)
\end{acculade}
}
\ent{(close-[input,output]-port \PORT)}{}
\res{(current-[input,output]-port)}{a port}
\ent{(line-length \OP)}{}
\ent{(current-column \OP)}{}
\ent{(flush-input \OP)}{}
\ent{(read \OP)}{read a full Scheme expression}
\ent{(read-atom \OP)}{}
\ent{(read-char \OP)}{}
\ent{(read-line \OP)}{}
\ent{(display \OBJ\ \OP)}{human-readable style; $\equiv$ {\tt princ}}
\ent{(write \OBJ\ \OP)}{machine style; $\equiv$ {\tt prin1}, {\tt print}}
\ent{(write-char \CHAR\ \OP)}{}
\ent{(writeln \IND\OBJ1 \ldots)}{}
\ent{(pp \OBJ\ \opt{port \opt{width}})}{pretty prints Scheme objects}
\ent{(newline \OP)}{}
\ent{(fresh-line \OP)}{}
\res{(print-length \OBJ)}{an integer}
\ent{(set-line-length!\ \argt{length} \OP)}{}
\res{(get-file-position \PORT)}{an integer}
\ent{(set-file-position!\ \PORT\ \argt{num-bytes} \argt{whence})}{}
	\note{\argt{whence} is \symb{SET} (0), \symb{CUR} (1) or \symb{END} (2)}
\ent{(call-with-[input,output]-file \argt{filename} \Proc{port})}{}
\vspace{2mm}
\ent{(make-window \opt{label\/ \opt{border?}})}{}
\ent{(window-clear \WIN)}{}
\ent{(window-scroll-[up,down] \WIN\ \opt{start-line \opt{end-line}})}{}
\ent{(window-delete \WIN)}{}
\ent{(window-popup[-delete] \WIN)}{}
\ent{(window-get-attribute \WIN\ \argt{name})}{}
	\note{\argt{name} is \symb{[BORDER,TEXT]-ATTRIBUTES}
		or \symb{WINDOW-FLAGS}}
\ent{(window-set-attribute!\ \WIN\ \argt{name} \argt{value})}{}
\ent{(window-reverse-text!\ \WIN)}{}
\res{(window-get-cursor \WIN)}{a pair: {\tt (\argt{line} .\ \argt{column})}}
\ent{(window-set-cursor!\ \WIN\ \argt{cursor-line} \argt{cursor-column})}{}
\res{(window-get-position \WIN)}{a pair. The top is at {\tt (0 .\ 0)}}
\ent{(window-set-position!\ \WIN\ \argt{ul-line} \argt{ul-column})}{}
\res{(window-get-size \WIN)}{a pair}
\ent{(window-set-size!\ \WIN\ \argt{\#lines} \argt{\#columns})}{}
\res{(window-save-contents \WIN)}{contents: binary string}
\ent{(window-restore-contents \WIN\ \argt{contents})}{}
\vfill

%============================================================ OPERATORS #5
\subsection*{Vectors}
\setlength{\entlength}{4.1cm}
%
Vectors are enclosed in {\tt \#(\ldots)}\\[1mm]
\ent{(vector?\ \VECT)}{}
\ent{(vector->list \VECT)}{}
\ent{(make-vector \argt{length} \opt{init-value})}{}
\res{(vector \OBJ\ \ldots)}{a new vector}
\ent{(vector-fill!\ \VECT\ \OBJ)}{}
\res{(vector-length \VECT)}{an integer}
\ent{(vector-ref \VECT\ \argt{index})}{\argt{index} starts at 0}
\ent{(vector-set!\ \VECT\ \argt{index} \OBJ)}{}

\subsection*{Environments}
\setlength{\entlength}{4.5cm}
%
\ent{USER-GLOBAL-ENVIRONMENT}{parent of {\tt USER-INITIAL-ENVIRONMENT}}
\ent{USER-INITIAL-ENVIRONMENT}{top-level environment}
\ent{(environment?\ \OBJ)}{}
\ent{(unbound?\ \IND\SYM1 \ldots\ \ENV)}{}
\ent{(access \IND\SYM1 \ldots\ \ENV)}{looks up \IND\SYM1 in (\ldots\ in \ENV)}
\ent{(define \argt{ident} \opt{exp})}{\argt{ident} is a name or a formals-list}
{\setlength{\entlength}{7cm}
\res{(make-environment \argt{scheme\_definition\_or\_exp} \ldots)}{an env}
}
\res{(the-environment)}{the current lexical environment}
{\setlength{\entlength}{5.2cm}
\res{(procedure-environment \argt{procedure})}{\argt{procedure}'s environment}
}
\ent{(environment-parent \ENV)}{}
\res{(environment-son \ENV)}{an (empty) child}
{\setlength{\entlength}{4.3cm}
\res{(environment-bindings \ENV)}{a list of name-value pairs}
}
\ent{(set!\ \argt{ident} \argt{exp})}{}
	\note{\argt{ident} is \argt{name}, {\tt (fluid \argt{name})} or {\tt (access \IND{\argt{name}}1 \ldots\ \ENV)}}
\ent{(unbind \SYM\ \ENV)}{}
\ent{(eval \argt{exp} \opt{env})}{}

\subsection*{Procedures, Continuations \& Engines}
\setlength{\entlength}{4.5cm}
\ent{(procedure?\ \OBJ)}{{\tt \#T} for procedures and continuations}
\ent{(continuation?\ \OBJ)}{}
\ent{(call/cc \Proc{continue})}{$\equiv$ {\tt call-with-current-continuation}}
\ent{(make-engine \argt{thunk})}{\argt{thunk} is \Proc{ticks success failure}}
\ent{(engine-return \argt{value})}{returns \argt{value} to the engine's caller}

\subsection*{Operating System}
\setlength{\entlength}{4.3cm}
%
\ent{(dos-call \argt{progname} \argt{parameters} \opt{memory-to-free \opt{restore-screen?}})}{}
\res{(dos-chdir \argt{directory-string})}{previous directory}
\ent{(dos-change-drive \argt{drive-string})}{}
\ent{(dos-delete \argt{filename})}{$\equiv$ {\tt delete-file}}
\res{(dos-get-dir \opt{drive-string})}{a string: the current directory}
\res{(dos-dir \argt{mask-string})}{a list of filenames}
\ent{(dos-get-env \argt{env-variable-name})}{}
\ent{(dos-put-env \argt{string})}{doesn't change parent's environment}
\ent{(dos-search-file \argt{filespec})}{searches upon {\tt PATH}}
\ent{(dos-file-copy \argt{source-filename} \argt{dest-filename})}{}
{\setlength{\entlength}{6.2cm}
\ent{(dos-rename \argt{current-filename} \argt{new-filename})}{can move files}
}
\ent{(dos-file-size \argt{filename})}{}
\ent{(\%system-file-name \argt{filename})}{prepends PCS files' path}
\res{(filename-split \argt{filename})}{{\tt (\argt{drive} \argt{path} \argt{name} \argt{ext})}}
{\setlength{\entlength}{6cm}
\res{(filename-merge (\argt{drive} \argt{path} \argt{name} \argt{ext}))}{\argt{filename}}
}
\vfill

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%============================================================ MISC #1
\section*{Command line}
\setlength{\entlength}{3.8cm}
\renewcommand{\entfont}{\tt}
%
\ent{SCHEME-TOP-LEVEL}{fluidly bound to the interpreter's loop}
\ent{(reset)}{resets the current interpreter loop}
\ent{(reset-scheme-top-level)}{binds the top-level to its default}
\ent{(scheme-reset)}{}
\res{(\%c $n$)}{query of \nth\ command-line entry}
\res{(\%d $n$)}{result of \nth\ command-line entry}
\vspace{2mm}
\res{(get-history)}{a list of strings: previous input lines}
\ent{(push-history \argt{string[--list]})}{}
\ent{(clear-history)}{}
\ent{(pcs-learn-symbols \argt{symbol-list})}{}
{\setlength{\entlength}{5.5cm}
\res{(pcs-recognize-symbol \argt{symbol} \opt{len})}{completion of \argt{symbol}}
}
\ent{(pcs-macro-keys \List{\List{key . replacement} \argt{\ldots}})}{}
\note{\argt{key} is an {\sc Ascii} code or a scan-code$\cdot${\tt\#x100}}
\note{\argt{replacement} is a [dotted-]list of strings}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section*{Miscellaneous}
\setlength{\entlength}{3.8cm}
\renewcommand{\entfont}{\tt}
%
\ent{PCS-DEBUG-MODE}{whether debug information is generated}
\ent{PCS-INTEGRATE-PRIMITIVES}{}
	\note{whether primitives are inline-expanded}
\ent{PCS-INTEGRATE-INTEGRABLES}{}
	\note{whether {\tt define-integrable}'s are inline-expanded}
\ent{*THE-NON-PRINTING-OBJECT*}{}
	\note{never printed, even by {\tt write}}
\ent{PCS-GC-MESSAGE}{}
	\note{string displayed during garbage collecting}
\ent{PCS-GC-RESET}{}
	\note{string normally displayed in the status window. Contains
	up to 2 ``{\tt \%lu}'': free scheme memory and kernel memory (in bytes)}
\vspace{2mm}
\ent{CLOCK-TICK}{number of ticks per second}
\res{(clock)}{number of ticks since start of PCS}
\note{there are $2^{16}$ ticks per hour, i.e.\ $\approx 18.2$ per second}
\ent{(time \opt{\symb{UNIX} $\mid$\symb{GM} $\mid$\symb{LOCAL}}
	\opt{language} \opt{source-time})}{}
\res{}{\argt{converted-time}}
\note{\argt{language}s supported are \symb{ENGLISH} and \symb{FRENCH}}
\note{a \argt{time} is an integer ({\sc Unix\/}-time) or a prefix of the list:}
\note{\List{sec min hour month-day month year week-day year-day}}
\note{\argt{source-time}'s fields default to current time values}
\vspace{2mm}
\ent{(text-mode \argt{{\sc Bios}-mode})}{$-1$ for previous mode, {\tt \#x40} for $50$ lines}
\ent{(full-screen)}{makes the console port as big as possible}
\ent{(split-screen \argt{height})}{shrinks the console to the bottom lines}
\ent{(gc-screen)}{positions {\tt PCS-STATUS-WINDOW}}
\vspace{2mm}
\ent{(load \argt{filename})}{\argt{filename} can be scheme, web or FSL code}
\ent{(fast-load \argt{FSL-filename})}{}
\ent{(fast-save-file \argt{source-file[--list]} \opt{dest-file})}{}
\ent{(autoload-from-file \argt{filename} \argt{list-of-variables} \opt{environment})}{}
\ent{(transcript-on \argt{filename})}{}
\ent{(transcript-off)}{}
\ent{(edit \argt{pair})}{the yukky list editor}
\ent{(gc \opt{compact?})}{invokes the garbage collector}
\res{(freesp)}{amount of free Scheme memory}
\ent{(exit \opt{DOS-return-value})}{}
\vfill

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%============================================================ PACK #1
\section*{SCOOPS: the Object Package}
\setlength{\entlength}{4.5cm}
\renewcommand{\entfont}{\tt}
%
\ent{(load-scoops)}{load Scoops package}
\begin{tabbing}
\tt (define-class \= \argt{name} \\
                  \> [(classvars \argt{item} \ldots)] \\
                  \> [(instvars [\argt{item},\argt{active-item}] \ldots)] \\
                  \> [(mixins \argt{item} \ldots)] \\
                  \> [(options \=[\argt{option}] \\
                  \>           \>[(\argt{option} \argt{variable} \ldots)]
	\ldots)])
\end{tabbing}
\vspace{-3mm}
\note{\argt{item} is {\tt (\argt{var} \argt{init-value})} or just
\argt{var} to leave it unbound}
\note{\argt{active-item} is {\tt (\argt{var} (active \argt{init-value} \argt{get-proc} \argt{set-proc}))}}
\note{\argt{option} is {\tt [gettable,settable,inittable]-variables}}
\note{\argt{option} applies on all variables when none is specified}
\ent{(define-method (\CLAS\ \argt{method}) (\opt{parameter} \ldots)
\argt{exp} \ldots)}{}
\ent{(delete-method (\CLAS\ \argt{method}))}{}
\ent{(make-instance \CLAS\ \argt{var} \argt{init-val} \ldots)}{}
\res{(class-of-object \argt{object})}{\argt{name}}
\ent{(send[-if-handles] \argt{object} \argt{msg} \opt{arg} \ldots)}{}
\note{{\tt send-if-handles} returns {\tt \#F} when \argt{object} cannot
handle \argt{msg}}
\vspace{2mm}
\ent{(class-compiled?\ \CLAS)}{}
\ent{(compile-class \CLAS)}{}
\res{(name->class \argt{name})}{\CLAS}
\ent{(rename-class (\CLAS\ \argt{name}))}{}
\ent{(describe [\CLAS,\argt{object}])}{displays a full description}
\res{(classvars \CLAS)}{a list of class variable names}
\ent{(all-classvars \CLAS)}{includes inherited class variables}
\ent{(instvars \CLAS)}{}
\ent{(all-instvars \CLAS)}{}
\ent{(methods \CLAS)}{}
\ent{(all-methods \CLAS)}{}
\ent{(mixins \CLAS)}{}
\res{(getcv \CLAS\ \argt{var})}{value of \argt{var} in \CLAS}
\ent{(setcv \CLAS\ \argt{var} \argt{exp})}{}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section*{Directory Structure}
\setlength{\entlength}{4.5cm}
%
\begin{tabbing}
sources\=/hershey\hspace{5mm}	\= \kill
\sf bin 	\>	\> executables and run-time librairies\\
\sf brief	\>	\> interface to {\sc Borland}'s editor\\
\sf doc		\>	\> \LaTeX, {\sc PostScript} and {\sc Ascii} docs\\
\sf samples	\>	\> small Scheme-{\tt WEB} demos\\
\sf sources 	\>\sf /asm	\> Kernel Turbo Assembler 3.1 source\\
		\>\sf /c	\> Kernel Borland C++ 3.1 source\\
		\>\sf /s	\> Kernel 4.02 Scheme source\\
		\>\sf /bgi	\> BGI tools, various sources\\
		\>\sf /hershey	\> Hershey fonts {\tt WEB} source\\
		\>\sf /lisp	\> Lisp compatibility Scheme source\\
		\>\sf /web	\> Scheme-{\tt WEB}, various sources
\end{tabbing}
\vfill
\newpage
\end{multicols}
\end{document}
